package com.example.administrator.printoutindemo;

import org.json.JSONArray;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class OutStorageMaterialCheckList implements Serializable {

    public String proid;
    public String deal_status;
    public String mbm;
    public String receive_username;
    public String receive_phone;
    private String _out_storageList_id;
    private String _projectname;
    private String _material;
    private String _out_storage_count;
    private String _unit;
    private String _out_storage_Estimate;
    private String _user_name;
    private String _out_storagelist_batchid;
    private String check_status;

    public String getProid() {
        return proid == null ? "" : proid;
    }

    public void setProid(String proid) {
        this.proid = proid == null ? "" : proid;
    }

    public String getDeal_status() {
        return deal_status == null ? "" : deal_status;
    }

    public void setDeal_status(String deal_status) {
        this.deal_status = deal_status == null ? "" : deal_status;
    }

    public String getMbm() {
        return mbm == null ? "" : mbm;
    }

    public void setMbm(String mbm) {
        this.mbm = mbm == null ? "" : mbm;
    }

    public String getReceive_username() {
        return receive_username == null ? "" : receive_username;
    }

    public void setReceive_username(String receive_username) {
        this.receive_username = receive_username == null ? "" : receive_username;
    }

    public String getReceive_phone() {
        return receive_phone == null ? "" : receive_phone;
    }

    public void setReceive_phone(String receive_phone) {
        this.receive_phone = receive_phone == null ? "" : receive_phone;
    }

    public String getCheck_status() {
        return check_status;
    }

    public void setCheck_status(String check_status) {
        this.check_status = check_status;
    }

    // 将JSON对象转化为list
    public List<OutStorageMaterialCheckList> getListFromJSON(String JsonStr) {
        List<OutStorageMaterialCheckList> clist = new ArrayList<OutStorageMaterialCheckList>();

        try {

            JSONArray jay = new JSONArray(JsonStr);// 将字符串转化为JSON数组

            for (int i = 0; i < jay.length(); i++) {
                JSONObject temp = (JSONObject) jay.get(i);

                OutStorageMaterialCheckList n = new OutStorageMaterialCheckList();

                n.set_out_storageList_id(temp.getString("out_storageList_id"));
                n.set_projectname(temp.getString("projectname"));
                n.set_material(temp.getString("material"));
                n.set_out_storage_count(temp.getString("out_storage_count"));
                n.set_unit(temp.getString("unit"));
                n.set_out_storage_Estimate(temp.getString("out_storage_Estimate"));
                n.set_user_name(temp.getString("user_name"));
                n.set_out_storagelist_batchid(temp.getString("out_storagelist_batchid"));
                n.setCheck_status(temp.getString("check_status"));
                n.setProid(temp.getString("proid"));

                clist.add(n);

            }

        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }

        return clist;

    }


    public String get_out_storageList_id() {
        return _out_storageList_id;
    }


    public void set_out_storageList_id(String _out_storageList_id) {
        this._out_storageList_id = _out_storageList_id;
    }


    public String get_projectname() {
        return _projectname;
    }

    public void set_projectname(String _projectname) {
        this._projectname = _projectname;
    }

    public String get_material() {
        return _material;
    }

    public void set_material(String _material) {
        this._material = _material;
    }

    public String get_out_storage_count() {
        return _out_storage_count;
    }

    public void set_out_storage_count(String _out_storage_count) {
        this._out_storage_count = _out_storage_count;
    }

    public String get_unit() {
        return _unit;
    }

    public void set_unit(String _unit) {
        this._unit = _unit;
    }

    public String get_out_storage_Estimate() {
        return _out_storage_Estimate;
    }

    public void set_out_storage_Estimate(String _out_storage_Estimate) {
        this._out_storage_Estimate = _out_storage_Estimate;
    }

    public String get_user_name() {
        return _user_name;
    }

    public void set_user_name(String _user_name) {
        this._user_name = _user_name;
    }

    public String get_out_storagelist_batchid() {
        return _out_storagelist_batchid;
    }


    public void set_out_storagelist_batchid(String _out_storagelist_batchid) {
        this._out_storagelist_batchid = _out_storagelist_batchid;
    }


}